import 'package:flutter_wan_android/data/base_data_layer_api.dart';
import 'package:flutter_wan_android/data/logic_result.dart';

import '../page_entity.dart';
import 'article_entity.dart';
import 'article_network_api.dart';

class ArticleRepository {
  final ArticleNetworkApi _networkApi;

  ArticleRepository(this._networkApi);

  Future<LogicResult<PageEntity<ArticleEntity>>> requestList(int page) {
    return performLogic(() async {
      PageEntity<ArticleEntity> pageEntity = await _networkApi.requestList(page);
      return pageEntity;
    });
  }
}
